﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Otonomos.World
{
    public class SimpleWall3D
    {
        public SimpleWall3D(Point3D firstPoint, Point3D secondPoint, WallType wallType)
        {
            if (secondPoint.Z <= firstPoint.Z)
            {
                throw new ArgumentException("Second point needs to be above first point!");
            }

            if (firstPoint.X == secondPoint.X && firstPoint.Y == secondPoint.Y)
            {
                throw new ArgumentException("Wall length must be greater 0!");
            }

            FirstPoint = firstPoint;
            SecondPoint = secondPoint;
            WallType = wallType;
        }

        public Point3D FirstPoint { get; set; }

        public Point3D SecondPoint { get; set; }

        public WallType WallType { get; set; }

        public double Height
        {
            get
            {
                return SecondPoint.Z - FirstPoint.Z;
            }
        }

        public double Length
        {
            get
            {
                return Math.Sqrt((FirstPoint.X - SecondPoint.X) * (FirstPoint.X - SecondPoint.X) +
                    (FirstPoint.Y - SecondPoint.Y) * (FirstPoint.Y - SecondPoint.Y));
            }
        }

        public double Distance(Point3D point)
        {
            return 0.0;
        }
    }
}
